
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Models.Entity
{
    /// <summary>
    /// 每周课表
    /// </summary>
    [Table(@"c_classes_cfg_teacher a 
             left join c_classes_cfg b on b.classes_cfg_id=a.classes_cfg_id 
             left join c_teacher_course c on c.teacher_course_id=a.teacher_course_id 
             left join c_teacher d on d.teacher_id=c.teacher_id 
             left join c_course e on c.course_id=e.course_id  
             ")]
    public class CClassesCfgTeacherCourseEntityView : BaseModel
    {

        /// <summary>
        /// teacher_cfg_id
        /// </summary>
        [Key]
        [Required]
        [Column("a.teacher_cfg_id")]
        public int teacher_cfg_id { get; set; }
        /// <summary>
        /// classes_cfg_id
        /// </summary>
        [Required]
        [Column("a.classes_cfg_id")]
        public int classes_cfg_id { get; set; }

        /// <summary>
        /// teacher_course_id
        /// </summary>
        [Required]
        [Column("a.teacher_course_id")]
        public int teacher_course_id { get; set; }

        /// <summary>
        /// teacher_id
        /// </summary>
        [Required]
        [Column("d.teacher_id")]
        public int teacher_id { get; set; }
        /// <summary>
        /// 每周节数
        /// </summary>
        [Required]
        [Column("a.week_num")]
        public int week_num { get; set; }

        /// <summary>
        /// 是否使用：0未使用，1已使用
        /// </summary>
        [Required]
        [Column("a.is_use")]
        public int is_use { get; set; }


        /// <summary>
        /// 年份
        /// </summary>
        [Required]
        [StringLength(10)]
        [Column("b.years")]
        public int years { get; set; }
        /// <summary>
        /// 编号
        /// </summary>
        [Required]
        [Column("b.num")]
        public int num { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        [Column("b.create_time")]
        public Int64 create_time { get; set; }

        /// <summary>
        /// 不排课编号
        /// </summary>
        [Column("b.no_course")]
        public string no_course { get; set; }

        /// <summary>
        /// 教师名称
        /// </summary>
        [Column("d.name")]
        public string teacher_name { get; set; }


        /// <summary>
        /// 场地
        /// </summary>
        /// <value></value>
        [Column("c.place_id")]
        public int place_id { get; set; }

        /// <summary>
        /// 连续上课节数
        /// </summary>
        /// <value></value>
        [Column("c.together_num")]
        public int together_num { get; set; }

        /// <summary>
        /// 教师不排课编号
        /// </summary>
        [Column("d.no_course")]
        public string tearch_no_course { get; set; }

                /// <summary>
        /// 教师不排课编号
        /// </summary>
        [Column("c.no_course")]
        public string course_no_course { get; set; }


        /// <summary>
        /// 课程名称
        /// </summary>
        [Required]
        [StringLength(20)]
        [Column("e.name")]
        public string course_name { get; set; }

        /// <summary>
        /// 类型：1文化课,2专业课
        /// </summary>
        /// <value></value>
        [Required]
        [Column("e.type_id")]
        public int type_id { get; set; }

        /// <summary>
        /// 合班ID
        /// </summary>
        [Required]
        [StringLength(20)]
        [Column("(SELECT GROUP_CONCAT(x.classes_id) FROM c_classes_cfg_teacher_classes x WHERE x.teacher_cfg_id = x.teacher_cfg_id and x.teacher_cfg_id=a.teacher_cfg_id)")]
        public string classesid_arr { get; set; }
    }
}
